home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Oct 89 / Z0114-Object Modula-2 Com-Oct89 < prev    next >
Encoding:
Text File  |  1989-10-20  |  3.0 KB  |  86 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  SCHMUCKER1   to DEREK
  2.  
  3. Item    4706901                         17-Oct-89        15:09
  4.  
  5. From:   LINS                            Lins, Chuck
  6.  
  7. To:     SCHMUCKER1                      Schmucker, Kurt
  8.  
  9. cc:     MACAPP.TECH$                    MACAPP Tech
  10.  
  11. Sub:    Object Modula-2 Compiler
  12.  
  13. Kurt, and everyone else,
  14.  
  15. Here's all the information I have at present on the Object Oriented Modula-2.
  16.  
  17. The compiler is distributed by
  18. p1, Gesellschaft fur Informatik mbH
  19. Gotthardstr. 99
  20. D-8000 Munich 21
  21. West Germany
  22.  
  23.  The compiler runs under MPW as a tool. The Modula-2 compiler has numerous
  24. extensions the most important of which is object-oriented support ala Object
  25. Pascal. The compiler produces object code fully compatible with Object Pascal's
  26. (e.g., object's use the dispatch table and methods are implemented similarly).
  27. Definition modules for MacApp are provided with the compiler. These modules
  28. currently define interfaces to macApp 2.0B5. Rather than try and describe the
  29. syntax I'll just give an example.
  30.  
  31. One declares an object type like this:
  32.  
  33. TYPE
  34.     TShape = OBJECT
  35.         boundRect: Rect;    (* an instance variable *)
  36.         METHOD IShape;      (* some methods *)
  37.         METHOD Draw (pat: Pattern);
  38.         ... etc ...
  39.     END;
  40.  
  41. TYPE
  42.     TArc = OBJECT (TShape)  (* a subclass of TShape *)
  43.         startAngle, stopAngle: INTEGER;
  44.         METHOD IArc;
  45.         OVERRIDE METHOD Draw (pat: Pattern);
  46.         ... etc ...
  47.     END;
  48.  
  49. Object variables are like those in Object Pascal. They're declared similarly,
  50. and there's no need to explicitly dereference them. Objects are allocated on
  51. the heap as handles. A special standard procedure GEN is used to create objects
  52. (like NEW does in Object Pascal). SELF and INHERITED woek just like their
  53. Pascal counterparts.
  54.  
  55.  
  56. In the non-object-oriented area, p1 Modula-2 supports further extensions to
  57. Modula-2 for the following constructs:
  58. * record aggregates
  59. * structured constants for records and arrays
  60. * multi-dimensional open array parameters
  61. * interfacing to other languages
  62. * conditional compilation
  63. * escape characters within strings (ala C)
  64. * symbolic debugger (kinda like Think Pascal's)
  65.  
  66. There's probably a few things I've forgotten but that's the major parts.
  67.  
  68. A large library of modules is provided (the MODUS library), as well as
  69. libraries supporting the Macintosh interface.
  70.  
  71. MacApp is supported as mentioned previously. Currently, p1 provides the
  72. interfaces which conform with 2.0B5. There's a tool which converts the Pascal
  73. MacApp interfaces into corresponding Modula-2 interfaces but at this time it's
  74. not provided with the product (no fully documented, doesn't do a 100%
  75. conversion so some manual effort still required).
  76.  
  77.  
  78. I haven't had any chance to try out the compiler since my current projects at
  79. Apple don't involve MacApp. If you want more info, please link Elmar Henne at
  80. GER.XDV0002 and say you heard it here on MacApp.Tech$ !
  81.  
  82. Chuck Lins
  83. Apple Computer, Inc.
  84. Disclaimer: The intersection of Apple's ideas and my ideas yields the empty set
  85.  
  86.